<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="../general/header.jsp" %>
	<div id="header">Items List</div>
	<%@ include file="../general/menu.jsp" %>
	<div id="left">
		<form:form id="id" action="${action}" commandName="filterForm" method="POST" >
			<span>
				Filter by:
				<form:select  id="categoryList" name="categoryid" path="category">
						<form:option value="" label="None"/>
						<form:options items="${categories}" itemValue="id" itemLabel="name"/>
				</form:select>
				
				<!--  ver como hacer automatico esto con spring! -->
				Order By:
				<form:select id="orderParameters" name="orderBy" path="orderBy">									
					<form:option value="" label="None"/>		
					<form:option value="name">Name</form:option>
					<form:option value="precio">Price</form:option>
					<form:option value="publicationDate">Publish Date</form:option>
					<form:errors path="orderBy" />
				</form:select>
			</span>
			<span id="direction">
				<form:radiobutton name="direction"  path="direction" value="0" /> Ascending
				<form:radiobutton name="direction" path="direction" value="1" /> Descending
			</span>
			<span>
				<input type="submit" value="Filter" />
			</span>
		</form:form>
	</div>
	<div id="content">
	<%@ include file="../item/list.jsp" %>
	</div>
<div style="clear:both;"></div>
<div id="bottom">
	<a href="../general/index">Go Back to Index</a>
</div>
<script type="text/javascript">
	hideDirection();
</script>
<%@ include file="../general/footer.jsp" %>
